package com.sw.bbs.board.vo.request.post;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sw.bbs.common.constant.BBSConstant;
import com.sw.bbs.common.vo.PageRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


/**
 * @Desc: 查询板块帖子请求体
 * @Author: wusonghe
 * @Date: 2019/3/4 16:02
 */
@ApiModel("帖子搜索请求体")
@Data
public class QueryPostRequest extends PageRequest {

    @ApiModelProperty("板块id，如果不传就是全网查询")
    private Integer boardId;

    @ApiModelProperty("查询关键字(模糊搜索) 1.帖子标题 2.帖子详情 3.板块(boardName优先)")
    private String keyword;

    @ApiModelProperty(value = "板块名字 模糊搜索")
    private String boardName;

    @ApiModelProperty(value = "帖子标签")
    private String tags;

    @ApiModelProperty("查询创建开始时间")
    @JsonFormat(pattern = BBSConstant.DATE_FORMAT, timezone= BBSConstant.DATE_TIMEZONE)
    @DateTimeFormat(pattern = BBSConstant.DATE_FORMAT)
    private Date startTime;

    @ApiModelProperty("查询创建结束时间")
    @JsonFormat(pattern = BBSConstant.DATE_FORMAT,timezone = BBSConstant.DATE_TIMEZONE)
    @DateTimeFormat(pattern = BBSConstant.DATE_FORMAT)
    private Date endTime;

    @ApiModelProperty("排序关键字 1.createTime 2.updateTime 3.点赞数")
    private String sortField;

    @ApiModelProperty("升序asc 降序desc")
    private String sortDesc;

    @ApiModelProperty("一次查询")
    private Integer onceQuery;

}
